package com.allen.imsystem.friend.mappers;

import com.allen.imsystem.friend.model.vo.FriendApplicationView;
import com.allen.imsystem.friend.model.pojo.FriendApply;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ClassName FriendApplyMapper
 * @Description 好友申请表的数据库操作
 * @Version 1.0
 */
@Repository
@Mapper
public interface FriendApplyMapper extends BaseMapper<FriendApply> {

    /**
     * 查询某用户已发出申请了但未被通过的好友id
     * @param uid 用户id
     * @return 未被通过的好友id列表
     */
    List<String> selectAquiredId(String uid);

    /**
     * 查询最新的好友申请列表
     * @param uid 用户uid
     * @param limit 限制条数
     * @return 好友申请vo列表
     */
    List<FriendApplicationView> selectLatestApply(@Param("uid") String uid, @Param("limit") Integer limit);
}
